package cs236369.hw5.servlet.listeners;

import java.io.IOException;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;

import cs236369.hw5.Hw5Conf;

public class Hw5ServletListener implements ServletContextListener
{
	
	
	@Override
	public void contextInitialized(ServletContextEvent event)
	{
		Logger logger = Logger.getLogger(getClass());
		try
        {
			logger.info("loading hw5 properties file");
	        Hw5Conf.initialize();
	        logger.info("[OK] hw5 poperties were loaded successfully");
			
        }
        catch (IOException e)
        {   
	        logger.error("[FAIL] loading hw5 properties", e);
        }
		
		
	}
	
	
	@Override
	public void contextDestroyed(ServletContextEvent event)
	{	
		
	}
}
